str=""
s={}
with open("大江东去.txt",encoding="utf8") as r,open("tongji.csv","w",encoding="utf8") as f:
    str=r.read()

    for l in str:
        s[l]=s.get(l,0)+1
    del s["\n"]
    del s["\ufeff"]

    for k,v in s.items():
       # print(k,str(v))
       f.write("%s,%d\n"%(k,v))
    #     //print(k,"的次数是：",v)
    # print(s)
